<?php

class IndexController extends YouNet_Controller_Action
{

	public function indexAction()
	{
		if( !Core_Util::isFacebookRequest() )
		{
			if ($this->_social->hasAppRequest())
			{
				$data = $this->_social->getAppRequestData();
				if (isset($data))
				{
					$data = json_decode($data, true);
					$params = array(
						'target'	=>	'detail',
						'id_product' => $data['id_product']
					);
					YouNet_Util::parentRedirect($this->_social->pageUrl($params, $data['id_page']));
				}	
			}	
			$this->disableAutoRender();
            $this->_social->redirect('/store/store/list');
		}
	}

}
